import java.util.Arrays;
import java.util.Map;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86185
 * Date: 2023-05-24
 * Time: 16:17
 */
abstract class Shape {
    public abstract double getPerimeter();

    public abstract double getArea();
    public  void print() {
        System.out.printf("%.2f ",getPerimeter());
        System.out.printf("%.2f\n",getArea());
    }
}
class Square extends Shape {
    public double length;

    public Square(double length) {
        this.length = length;
    }

    @Override
    public double getPerimeter() {
        return length * 4;
    }

    @Override
    public double getArea() {
        return length * length;
    }
}
class Rectangle extends Shape {
    public double length;
    public double width;

    public Rectangle(double length, double width) {
        this.length = length;
        this.width = width;
    }

    @Override
    public double getPerimeter() {
        return (length + width) * 2;
    }

    @Override
    public double getArea() {
        return length * width;
    }
}
class Circle extends Shape {
    public double r;

    public Circle(double r) {
        this.r = r;
    }

    @Override
    public double getPerimeter() {
        return 2 * r * Math.PI;
    }

    @Override
    public double getArea() {
        return r * r * Math.PI;
    }
}
public class Test2 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Shape square = new Square(scanner.nextDouble());
        Shape rectangle = new Rectangle(scanner.nextDouble(), scanner.nextDouble());
        Shape circle = new Circle(scanner.nextDouble());
        square.print();
        rectangle.print();
        circle.print();
    }
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String string = scanner.nextLine();
        int count = 0;
        for (char c:
             string.toCharArray()) {
            if(c == ';') {
                count++;
            }
        }
        int[][] arr = new int[count + 1][];
        int num = 0;
        int k = 0;
        int j = 0;
        char c = string.charAt(0);
        for (int i = 0; i < count + 1; i++) {
            arr[i] = new int[0];
            j = 0;
            while(c != ';') {
                num = 0;
                while(c != ',' && c != ';' && k != string.length()) {
                    num = num * 10 + c - '0';
                    if(k + 1 != string.length()) {
                        c = string.charAt(++k);
                    } else {
                        k++;
                    }
                }
                arr[i] = Arrays.copyOf(arr[i], arr[i].length + 1);
                arr[i][j++] = num;
                if(c == ';') {
                    c = string.charAt(++k);
                    break;
                }
                if(k == string.length()) {
                    break;
                }
                c = string.charAt(++k);
            }
        }
        for (int i = 0; i < arr.length; i++) {
            for (int l = 0; l < arr[i].length; l++) {
                if(l == 0) {
                    System.out.print("d[" + i + "," + l + "] = " + arr[i][l]);
                } else {
                    System.out.print(" d[" + i + "," + l + "] = " + arr[i][l]);
                }
            }
            System.out.println();
        }
    }
    public static void showTotal(int [][]sale) {
        int sumAll = 0;
        for (int i = 0; i < sale.length; i++) {
            int sum = 0;
            for (int j = 0; j < sale[i].length; j++) {
                sum += sale[i][j];
            }
            sumAll += sum;
            System.out.println(i+1 + "季度的销售额为：" + sum);
        }
        System.out.println("全年销售额为：" + sumAll);
    }

    public static void main2(String[] args) {
        int[][] sale = new int[4][3];
        Scanner scanner = new Scanner(System.in);
        for (int i = 0; i < sale.length; i++) {
            for (int j = 0; j < sale[i].length; j++) {
                sale[i][j] = scanner.nextInt();
            }
        }
        showTotal(sale);
    }
}
